#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<ctype.h>
int main(void)
{
	int i = 0, j = 0;
	char ch = 0;
	while ((ch = getchar()) != EOF)
	{
		if (isupper(ch))
			i++;
		else if (islower(ch))
			j++;
	}
	printf("%d %d", i, j);

	return 0;
}